import request from "@/api/request";

//创建物品
export const creatItem = (value: any) => {
    return request({
        method: "post",
        url: "rest/item",
        data: value,
    });
};



//获取物品列表数据
export const getItem = () => {
    return request({
        method: "get",
        url: "rest/item",
    });
};


//获取被编辑物品的详情
export const getEditItem = (id:string[] | string) => {
    return request({
        method:'get',
        url:`rest/item/${id}`
    })
}

//更新物品数据
export const upDateItem = (id:string | string[],data:any) => {
    return request({
        method:'put',
        url:`rest/item/${id}`,
        data:data,
    })
}

//删除物品
export const deletItem = (id:string | string[]) => {
    return request({
        method:'delete',
        url:`rest/item/${id}`
    })
}